package com.dxt.rabbitmq.service.ack;

import com.dxt.rabbitmq.config.ConsumerAckConfig;
import com.dxt.rabbitmq.vo.TestMessage;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AckPublisher {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    public void publish(TestMessage testMessage){
        System.out.println("AckPublisher send message: " + testMessage.toString());
        rabbitTemplate.convertAndSend(ConsumerAckConfig.EXCHANGE, "", testMessage);
    }
}
